<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>请描述下面代码的输出结果以及运行原因</title>
    <script>
        var num = 1;
        function demo() {
            console.log(num);
            function demoSon() {
                num = 3;
            }
            var num = 2
            demoSon();
        }
        demo()
    </script>
</head>

<body>

</body>

</html>